package com.nbufe.enums;

/**
 * 生产阶段类型枚举（1燃料燃烧 2工业生产 3电力热力 4固碳产品）
 *
 * @Author luzhiheng
 * @Date 2023/12/22 16:48
 */
public enum StageEnum {
    FOSSI_FUEL("燃料燃烧", 1),
    INDUSTRIAL_PRODUCTION("工业生产", 2),
    ELECTRIC_HEAT("电力热力", 3),
    CARBON_SEQUESTRATION_PRODUCT("固碳产品", 4),
    ;

    private final String code;

    private final Integer value;

    StageEnum(String code, Integer value) {
        this.code = code;
        this.value = value;
    }

    public static Integer getValue(String code) {
        for (StageEnum value : StageEnum.values()) {
            if (value.code.equals(code)) {
                return value.value;
            }
        }
        return -1;
    }

    public static String getCode(Integer v) {
        for (StageEnum value : StageEnum.values()) {
            if (value.value.equals(v)) {
                return value.code;
            }
        }
        return "";
    }

    public String getCode() {
        return code;
    }

    public Integer getValue() {
        return value;
    }
}
